package abd.pr1.Interface;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class NuevoComentarioSerieWindow extends JFrame{

	private static final long serialVersionUID = 1L;
	
	private JTextArea comentarioSerie;
	private JButton guardar;
	private JButton cerrar;
	public NuevoComentarioSerieWindow(){
		super();
		this.build();
		this.setSize(500, 500);
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}

	private void build() {
		
		this.getContentPane().setLayout(new BorderLayout());
		
		JLabel comentarioLabel= new JLabel("Comentario:");
		comentarioSerie=new JTextArea();
		
		
		JPanel comentarioPanel = new JPanel(new BorderLayout());
		
		comentarioPanel.add(comentarioLabel,BorderLayout.NORTH);
		comentarioPanel.add(comentarioSerie,BorderLayout.CENTER);
		

		 guardar = new JButton("Guardar");
		 guardar.setActionCommand("guardar_comentario_serie");
		 
		 cerrar = new JButton("Cerrar");
		 cerrar.setActionCommand("cerrar_comentario_serie");
		 
		JPanel botones = new JPanel();
		botones.add(guardar);
		botones.add(cerrar);
		
		this.getContentPane().add(comentarioPanel,BorderLayout.NORTH);
		this.getContentPane().add(botones,BorderLayout.SOUTH);
		}
	public void addListener(ActionListener a){
		guardar.addActionListener(a);
		cerrar.addActionListener(a);
	}
	public String getComentario(){
		return this.comentarioSerie.getText();
	}
}
